<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>
		选择店铺
	</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<script src="{{__PUBLIC__}}/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="{{__PUBLIC__}}/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/hdjs/hdjs.css"/>
	<script src="{{__PUBLIC__}}/bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/bootstrap/css/bootstrap.css"/>
	<link rel="stylesheet" href="public/kindeditor/themes/default/default.css" />
	<script src="public/kindeditor/kindeditor.js"></script>
	<script src="public/kindeditor/lang/zh_CN.js"></script>
	<script src="{{__PUBLIC__}}/js/common.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=WcqLYXBH2tHLhYNfPNpZCD4s"></script>
	<script type="text/javascript" src="public/js/map.js"></script>
	<script type="text/javascript">var root = "{{__ROOT__}}";</script>
</head>
<body>
	<ul>
		{{foreach from="$data" key="$k" value="$v"}}
		<li lng="{{$v['lng']}}" lat="{{$v['lat']}}">
			<img src="{{$v['thumb']}}" style="width:50px;"/>
			<a href="{{U('lists',array('dpid'=>$v['id']))}}">
				{{$v['name']}} 距离 <span></span> 米
			</a>
		</li>
		{{endforeach}}
	</ul>
	<script type="text/javascript">
		$(function(){
			getGeolocation(function(point) {
				var lng2 = point.lng;
				var lat2 =  point.lat;
				$('ul li').each(function(i){
					var lng1=$(this).attr('lng');
					var lat1=$(this).attr('lat');
					pos={lng1:lng1,lat1:lat1,lng2:lng2,lat2:lat2};
					$(this).find('span').html(getDistance(pos));
				});
			})
		});
	</script>
</body>
</html>






